package com.inspur.sc.springboot.config;

import org.apache.hadoop.conf.Configuration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.Set;

@Component
@ConfigurationProperties(prefix = "hadoop")
public class HadoopProperties {

    private Map<String, String> config;

    public Configuration getConfig() {
        Configuration conf=new Configuration();
        Set<String> keySet = config.keySet();
        for (String key : keySet) {
            conf.set(key, config.get(key));
        }
        return conf;
    }

    public void setConfig(Map<String, String> config) {
        this.config = config;
    }
}
